/*
 * FileAssistant interface. 
 */
package filesystem;

import java.io.*;
import java.util.ArrayList;
import java.util.Map;
import model.ModelItem;

/**
 *
 * @author ArieS
 */
public interface FileAssistant {

    /**
     * Remove item from the file system.
     *
     * @param id identificator of the object of ModelItem.
     * @throws IOException
     */
    public void removeItem(int id) throws IOException;

    /**
     * Change the value of the object and save it in the file system.
     *
     * @param item object of ModelItem.
     * @throws IOException
     */
    public void setItem(ModelItem item) throws IOException;

    /**
     *
     * @param id identificator of the object of ModelItem.
     * @return ModelItem's example which has this id.
     * @throws IOException
     */
    public ModelItem getItem(int id) throws IOException;

    /**
     * Add item and save it in the file system.
     *
     * @param item object of ModelItem.
     * @throws IOException
     */
    public void addItem(ModelItem item) throws IOException;

    /**
     *
     * @param name name of the item.
     * @return ArrayList of the objects of ModelItems which has this name.
     * @throws IOException
     */
    public ArrayList getItems(String name) throws IOException;

    /**
     *
     * @param map map where keys are parametr's names and values are regexes or
     * other maps
     * @return ArrayList of the objects of ModelItems which has this valeues.
     * @throws IOException
     */
    public ArrayList getItems(Map map) throws IOException;

    /**
     *
     * @param map map where keys are parametr's names and values are regexes or
     * other maps
     * @param al ArrayList of the objects
     * @return ArrayList of the objects of ModelItems which has this valeues.
     * @throws IOException
     */
    public ArrayList getItems(Map map, ArrayList al) throws IOException;

    /**
     *
     * @return ArrayList of the all objects of ModelItem
     * @throws IOException
     */
    public ArrayList getItems() throws IOException;

    /**
     * Make buffer's flag false.
     */
    public void resetLoaded();
}
